//
//  SingletonServiceIP.m
//  Estate
//
//  Created by heyong on 2017/4/5.
//  Copyright © 2017年 ttsx. All rights reserved.
//

#import "SingletonServiceIP.h"

@implementation SingletonServiceIP

static SingletonServiceIP *manager = nil;


+(SingletonServiceIP *)sharedManager{
    @synchronized(self){
       if(manager == nil){
           manager = [[SingletonServiceIP alloc]init];
        }
    }
    return manager;
}

+(id)allocWithZone:(NSZone *)zone{
    @synchronized(self){
        if (!manager) {
            //确保使用同一块内存地址
            manager = [super allocWithZone:zone];
            return manager;
        }
        return nil;
    }
}

- (id)copyWithZone:(NSZone *)zone
{
    return self;
}

- (id)init;
{
    @synchronized(self) {
        if (self = [super init]){
            return self;
        }
        return nil;
    }
}

@end
